package com.gxa.dr2.controller;

import com.gxa.dr2.dto.Response;
import com.gxa.dr2.dto.ResultDTO;
import com.gxa.dr2.pojo.Menu;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
public class MenuController {


    /**
     * 获取菜单数据
     * @param session
     * @return
     */
    @PostMapping("/menu/list")
    public ResultDTO getMenus(HttpSession session){
        List<Menu> menus = (List<Menu>) session.getAttribute("menus");
        return Response.success(menus);
    }


}
